package ex;

public class Ex8 {
    public static void main(String [] args){
        String s = "wz420by";
        if (s.matches(".*\\d.*")){
            System.out.printf("%s有数字%n",s);
        }else{
            System.out.printf("%s没有数字%n",s);
        }
    }
}
//.matches()方法